package sel.me.spring.boot159.web.config;

import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;

import java.util.Arrays;

/**
 * @Description TODO
 * @Author yinhe402
 * @dATE 2019/2/10 17:47
 * @Version 1.0
 **/

@ServletComponentScan(value = {"com.wzkj.test"})
public class TestBeanFactoryAnnotationConfig {

    @Primary
    @Bean(name = "test")

    public static void main(String[] args) {
        AnnotationConfigApplicationContext app = new AnnotationConfigApplicationContext(TestBeanFactoryAnnotationConfig.class);
        Arrays.stream(app.getBeanDefinitionNames()).forEach(item->{
            System.out.println("当前的bean为："+item);
        });
        app.close();
    }
}
